let 每日龙虎榜Controller = require('./controller/1每日龙虎榜Controller.js'),
    沪股通历史数据Controller = require('./controller/2沪股通历史数据Controller.js'),
    深股通历史数据Controller = require('./controller/3深股通历史数据Controller.js'),
    港股通_沪_历史数据Controller = require('./controller/4港股通(沪)历史数据Controller.js'),
    港股通_深_历史数据Controller = require('./controller/5港股通(深)历史数据Controller.js'),
    证券公司Controller = require('./controller/6证券公司Controller.js'),
    每日龙虎榜明细Controller = require('./controller/7每日龙虎榜明细Controller.js'),
    沪深港通个股数据_北向Controller = require('./controller/8沪深港通个股数据_北向Controller.js'),
    沪深港通个股数据_南向Controller = require('./controller/9沪深港通个股数据_南向Controller.js'),
    沪深港通个股数据_沪股通Controller = require('./controller/10沪深港通个股数据_沪股通Controller.js'),
    沪深港通个股数据_深股通Controller = require('./controller/11沪深港通个股数据_深股通Controller.js'),
    沪深港通每日机构_北向Controller = require('./controller/12沪深港通每日机构_北向Controller.js'),
    沪深港通每日机构_南向Controller = require('./controller/13沪深港通每日机构_南向Controller.js'),
    沪深港通每日机构_沪股通Controller = require('./controller/14沪深港通每日机构_沪股通Controller.js'),
    沪深港通每日机构_深股通Controller = require('./controller/15沪深港通每日机构_深股通Controller.js'),
    // 沪深港通历史数据_沪股通Controller = require('./controller/16沪深港通历史数据_沪股通Controller.js'),
    // 沪深港通历史数据_深股通Controller = require('./controller/17沪深港通历史数据_深股通Controller.js'),
    // 沪深港通历史数据_港股通沪Controller = require('./controller/18沪深港通历史数据_港股通沪Controller.js'),
    // 沪深港通历史数据_港股通深Controller = require('./controller/19沪深港通历史数据_港股通深Controller.js'),
    日主力_沪深两市实时资金流向_沪市A股Controller = require('./controller/20日主力_沪深两市实时资金流向_沪市A股Controller.js'),
    日主力_沪深两市实时资金流向_深市A股Controller = require('./controller/21日主力_沪深两市实时资金流向_深市A股Controller.js'),
    日主力_沪深两市实时资金流向_创业板Controller = require('./controller/22日主力_沪深两市实时资金流向_创业板Controller.js'),
    日主力_沪深两市实时资金流向_中小板Controller = require('./controller/23日主力_沪深两市实时资金流向_中小板Controller.js'),
    日主力_行业资金流Controller = require('./controller/24日主力_行业资金流Controller.js'),
    日主力_概念资金流Controller = require('./controller/25日主力_概念资金流Controller.js'),
    日主力_地域资金流Controller = require('./controller/26日主力_地域资金流Controller.js'),
    字典_沪深股票列表Controller = require('./controller/27字典_沪深股票列表Controller.js'),
    财报_财务诊断明细数据Controller = require('./controller/28财报_财务诊断明细数据Controller.js'),
    每日活跃营业部Controller = require('./controller/29每日活跃营业部Controller.js'),
    主力持仓_基金Controller = require('./controller/30主力持仓_基金Controller.js'),
    主力持仓_QFIIController = require('./controller/31主力持仓_QFIIController.js'),
    主力持仓_社保_Controller = require('./controller/32主力持仓_社保_Controller.js'),
    主力持仓_券商_Controller = require('./controller/33主力持仓_券商_Controller.js'),
    主力持仓_保险_Controller = require('./controller/34主力持仓_保险_Controller.js'),
    主力持仓_信托_Controller = require('./controller/35主力持仓_信托_Controller.js'),
    个股_主力持仓_基金Controller = require('./controller/36个股_主力持仓_基金Controller.js'),
    公告数据_分红Controller = require('./controller/37公告数据_分红Controller.js'),
    营业部Controller = require('./controller/38营业部Controller.js'),
    中国股市指数Controller = require('./controller/39中国股市指数Controller.js'),
    个股龙虎榜Controller = require('./controller/40个股龙虎榜Controller.js'),
    买入信号列表Controller = require('./controller/41买入信号列表Controller.js')





function addDate(date, days) {
    var d = new Date(date);
    d.setDate(d.getDate() + days);
    var m = d.getMonth() + 1;
    return d.getFullYear() + '-' + m + '-' + d.getDate();
}


async function Task() {
    // let startDate = '2015-01-01'
    let startDate = addDate(new Date(), -2);
    let isCache = false;
    await 每日龙虎榜Controller.main(startDate, isCache); //1
    await 沪股通历史数据Controller.main(startDate, isCache); //2
    await 深股通历史数据Controller.main(startDate, isCache); //3
    await 港股通_沪_历史数据Controller.main(startDate, isCache); //4
    await 港股通_深_历史数据Controller.main(startDate, isCache); //5
    await 证券公司Controller.main(startDate, isCache); //6
    await 每日龙虎榜明细Controller.main(startDate, isCache); //7 
    await 沪深港通个股数据_北向Controller.main(startDate, isCache); //8
    await 沪深港通个股数据_南向Controller.main(startDate, isCache); //9
    await 沪深港通个股数据_沪股通Controller.main(startDate, isCache); //10
    await 沪深港通个股数据_深股通Controller.main(startDate, isCache); //11
    await 沪深港通每日机构_北向Controller.main(startDate, isCache); //12
    await 沪深港通每日机构_南向Controller.main(startDate, isCache); //13
    await 沪深港通每日机构_沪股通Controller.main(startDate, isCache); //14
    await 沪深港通每日机构_深股通Controller.main(startDate, isCache); //15
    await 日主力_沪深两市实时资金流向_沪市A股Controller.main(startDate, isCache); //20
    await 日主力_沪深两市实时资金流向_深市A股Controller.main(startDate, isCache); //21
    await 日主力_沪深两市实时资金流向_创业板Controller.main(startDate, isCache); //22
    await 日主力_沪深两市实时资金流向_中小板Controller.main(startDate, isCache); //23
    await 日主力_行业资金流Controller.main(startDate, isCache); //24
    await 日主力_概念资金流Controller.main(startDate, isCache); //25
    await 日主力_地域资金流Controller.main(startDate, isCache); //26
    await 字典_沪深股票列表Controller.main(startDate, isCache); //27
    await 每日活跃营业部Controller.main(startDate, isCache); //29
    await 主力持仓_基金Controller.main(startDate, isCache); //30
    await 主力持仓_QFIIController.main(startDate, isCache); //31
    await 主力持仓_社保_Controller.main(startDate, isCache); //32
    await 主力持仓_券商_Controller.main(startDate, isCache); //33
    await 主力持仓_保险_Controller.main(startDate, isCache); //34
    await 主力持仓_信托_Controller.main(startDate, isCache); //35
    await 营业部Controller.main(startDate, isCache); //38
    await 中国股市指数Controller.main(startDate, isCache); //39
    await 个股龙虎榜Controller.main(startDate, isCache);//40
    await 买入信号列表Controller.main(startDate, isCache);//41
}
/**
 * 季度任务
 */
async function quarterTask() {
    let startDate = '2015-01-01'
    // let startDate = addDate(new Date(), -2);
    let isCache = true;
    // await 财报_财务诊断明细数据Controller.main(startDate, isCache); //28 耗时   季度更新
    await 个股_主力持仓_基金Controller.main(startDate, isCache); //36 耗时  季度更新
    // await 公告数据_分红Controller.main(startDate, isCache); //37 季度更新
}

async function test() {
    let startDate = addDate(new Date(), -2);
    let isCache = true;
    await 买入信号列表Controller.main(startDate, isCache);//41
}

async function main() {
    // await Task()
    // await quarterTask()
    await test();
    console.log('END')

}

main();